<div class="org-deparments">
  <div nz-row>
    <div class="deparment-item p-15" nz-col nzSpan="6" *ngFor="let department of departmentList">
      <nz-card style="width: 100%;" [nzActions]="[actionSetting, actionEdit, actionEllipsis]">
        <nz-card-meta [nzTitle]="department.nodeName" [nzDescription]="desTemplate" [nzAvatar]="avatarTemplate">
        </nz-card-meta>
      </nz-card>
      <ng-template #avatarTemplate>
        <nz-avatar [nzText]="department.nodeName[0]" style="color:#fff; background-color:#96d24e;">
        </nz-avatar>
      </ng-template>
      <ng-template #actionSetting>
        <i nz-tooltip class="iconfont icon-edit-fill" (click)="editDepartment(department)" nzTooltipTitle="编辑"
          nzTooltipPlacement="top"></i>
      </ng-template>
      <ng-template #actionEdit>
        <i nz-tooltip class="iconfont icon-delete-bin-5-line" (click)="deleteDepartment(department)" nzTooltipTitle="删除"
          nzTooltipPlacement="top"></i>
      </ng-template>
      <ng-template #actionEllipsis>
        <i nz-tooltip class="iconfont icon-user-line" (click)="goToUserPage(department)" nzTooltipTitle="部门人员"
          nzTooltipPlacement="top"></i>
      </ng-template>
      <ng-template #desTemplate>
        <div>
          部门负责人：{{department.leader?.nodeName}} <a *ngIf="!department.leader"
            (click)="editDepartment(department)">去添加</a>
        </div>
        <div>
          部门人数：{{department.users?department.users.length:0}} 人
        </div>
      </ng-template>
    </div>
    <div class="deparment-item p-15" nz-col nzSpan="6">
      <div class="dp-add" (click)="addDepartment()">
        <i class="iconfont icon-add-box-line"></i>
        添加部门
      </div>
    </div>
  </div>
</div>